06. Creating and Dropping

Creating and Dropping

Question:

Start Quiz:

Solution:

INSTRUCTOR NOTE:

Since not everything fits on the screen at once, here's what to try in psql:

  • Create a new database called fishies (or whatever you like).
  • Connect to it with \c fishies, or by exiting psql and running psql fishies.
  • In the new database, create a table that has two columns: a text column and a serial column.
  • Try running insert statements into this table, providing only a value for the text column. (For an example, scroll down to the bottom of this page.)

Look up these commands in the PostgreSQL documentation:

Create Database
Drop Database
Create Table
Drop Table


Here's an example insert statement you might try. Replace sometable with the name of the table you created:

insert into sometable values ('This is text!');

For more detail on the serial type, take a look at the last section of this page in the PostgreSQL manual:
http://www.postgresql.org/docs/9.4/static/datatype-numeric.html